#include<vector>
#include<algorithm>
using std::vector;
using std::min;
using std::max;


class Solution {
public:
    bool canJump(vector<int>& nums) {
        if (nums.size() == 1) return true;
        int rightBoard = nums[0];
        for (int i = 1; i < nums.size() && i <= rightBoard; i++) {
            rightBoard = max(i + nums[i], rightBoard);
        }
        return rightBoard >= nums.size()-1;
    }


    
};